package coumo.jdbc.driver;

public class COUMOErrorCode
{
  public static int unknown = 0;
  public static int connection_closed = 1;
  public static int statement_closed = 2;
  public static int prepared_statement_closed = 3;
  public static int result_set_closed = 4;
  public static int not_supported = 5;
  public static int invalid_trans_iso_level = 6;
  public static int invalid_url = 7;
  public static int no_dbname = 8;
  public static int invalid_query_type_for_executeQuery = 9;
  public static int invalid_query_type_for_executeUpdate = 10;
  public static int negative_value_for_length = 11;
  public static int ioexception_in_stream = 12;
  public static int deprecated = 13;
  public static int not_numerical_object = 14;
  public static int invalid_index = 15;
  public static int invalid_column_name = 16;
  public static int invalid_row = 17;
  public static int conversion_error = 18;
  public static int invalid_tuple = 19;
  public static int invalid_value = 20;
  public static int not_collection = 21;
  public static int dbmetadata_closed = 22;
  public static int non_scrollable = 23;
  public static int non_sensitive = 24;
  public static int non_updatable = 25;
  public static int non_updatable_column = 26;
  public static int invalid_query_type_for_executeInsert = 27;
  public static int argument_zero = 28;
  public static int empty_inputstream = 29;
  public static int empty_reader = 30;
  public static int insertion_query_fail = 31;
  public static int non_scrollable_statement = 32;
  public static int iss_fail_login = 33;
  public static int pooled_connection_closed = 34;
  public static int xa_connection_closed = 35;
  public static int xa_illegal_operation = 36;
  public static int oid_closed = 37;
  public static int invalid_table_name = 38;

  public static String[] err_msg = 
  {
      /* 0 -- 9 */
      "",
      "Attempt to operate on a closed Connection.",
      "Attempt to access a closed Statement.",
      "Attempt to access a closed PreparedStatement.",
      "Attempt to access a closed ResultSet.",
      "Not supported method",
      "Unknown transaction isolation level.",
      "invalid URL",
      "The database name should be given.",
      "The query is not applicable to the executeQuery(). Use the executeUpdate() instead.",

      /* 10 -- 19 */
      "The query is not applicable to the executeUpdate(). Use the executeQuery() instead.",
      "The length of the stream cannot be negative.",
      "An IOException was caught during reading the inputstream.",
      "Not supported method, because it is deprecated.",
      "The object does not seem to be a number.",
      "Missing or invalid position of the bind variable provided.",
      "The column name is invalid.",
      "Invalid cursor position.",
      "Type conversion error.",
      "Internal error: The number of attributes is different from the expected.",
      
      /* 20 -- 29 */
      "The argument is invalid.",
      "The type of the column should be a collection type.",
      "Attempt to operate on a closed DatabaseMetaData.",
      "Attempt to call a method related to scrollability of non-scrollable ResultSet.",
      "Attempt to call a method related to sensitivity of non-sensitive ResultSet.",
      "Attempt to call a method related to updatability of non-updatable ResultSet.",
      "Attempt to update a column which cannot be updated.",
      "The query is not applicable to the executeInsert().",
      "The argument row can not be zero.",
      "Given InputStream object has no data.",
      
      /* 30 -- 39 */
      "Given Reader object has no data.",
      "Insertion query failed.",
      "Attempt to call a method related to scrollability of TYPE_FORWARD_ONLY Statement.",
      "Authentication failure",
      "Attempt to operate on a closed PooledConnection.",
      "Attempt to operate on a closed XAConnection.",
      "Illegal operation in a distributed transaction",
      "Attempt to access a COUMOOID associated with a Connection which has been closed.",
      "The table name is invalid."
  };

  public static String getMessage(int code)
  {
    return err_msg[code];
  }
}
